package com.bosssoft.boss_exam_db.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Table: admin
 */
@Data
public class Admin implements Serializable {
    /**
     * 管理员唯一标识字段
     *
     * Table:     admin
     * Column:    id
     * Nullable:  false
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private String id;

    /**
     * 管理员名称字段
     *
     * Table:     admin
     * Column:    username
     * Nullable:  false
     */
    private String username;

    /**
     * 管理员密码字段
     *
     * Table:     admin
     * Column:    password
     * Nullable:  false
     */
    private String password;

    /**
     * 最近一次登录IP地址记录字段
     *
     * Table:     admin
     * Column:    last_login_ip
     * Nullable:  true
     */
    @Column(name = "last_login_ip")
    private String lastLoginIp;

    /**
     * 最近一次登录时间
     *
     * Table:     admin
     * Column:    last_login_time
     * Nullable:  true
     */
    @Column(name = "last_login_time")
    private Date lastLoginTime;

    /**
     * 所属部门
     *
     * Table:     admin
     * Column:    department_id
     * Nullable:  true
     */
    @Column(name = "department_id")
    private String departmentId;

    /**
     * 所属公司
     *
     * Table:     admin
     * Column:    company_id
     * Nullable:  true
     */
    @Column(name = "company_id")
    private String companyId;

    /**
     * 头像图片记录字段
     *
     * Table:     admin
     * Column:    avatar
     * Nullable:  true
     */
    private String avatar;

    /**
     * 邮箱
     *
     * Table:     admin
     * Column:    mail
     * Nullable:  false
     */
    private String mail;

    /**
     * 电话，可能跨国需要如+86
     *
     * Table:     admin
     * Column:    phone
     * Nullable:  false
     */
    private String phone;

    /**
     * 创建时间记录字段
     *
     * Table:     admin
     * Column:    add_time
     * Nullable:  true
     */
    @Column(name = "add_time")
    private Date addTime;

    /**
     * 添加人ID
     *
     * Table:     admin
     * Column:    add_people_id
     * Nullable:  true
     */
    @Column(name = "add_people_id")
    private String addPeopleId;

    /**
     * 添加人类型
     *
     * Table:     admin
     * Column:    add_people_type
     * Nullable:  true
     */
    @Column(name = "add_people_type")
    private Integer addPeopleType;

    /**
     * 修改人ID
     *
     * Table:     admin
     * Column:    update_people_id
     * Nullable:  true
     */
    @Column(name = "update_people_id")
    private String updatePeopleId;

    /**
     * 最后一次修改时间
     *
     * Table:     admin
     * Column:    update_time
     * Nullable:  true
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 逻辑删除字段
     *
     * Table:     admin
     * Column:    deleted
     * Nullable:  true
     */
    private Boolean deleted;

    /**
     * 乐观锁版本字段
     *
     * Table:     admin
     * Column:    version
     * Nullable:  true
     */
    private Integer version;

    private List<Role> roles;

    private static final long serialVersionUID = 1L;
}